const { createLogger } = require('winston');

const LOGGER_CONF = require('../conf/logger');

module.exports = function () {
  const logger = createLogger(LOGGER_CONF);

  return async function (ctx, next){
    ctx.logger = logger;
    await next();
  }
};